<pw:html>
    <pw:head>
        <title>Create {$entity->singular}</title>

        <pw:component name="pw_include_view" data-show="true" data-src="head_scripts.html"></pw:component>
    </pw:head>

    <pw:body>

        <pw:component name="pw_include_view" data-show="true" data-src="header.html"></pw:component>

        <div class="container">
            <pw:component name="pw_include_view" data-show="true" data-src="messages.html"></pw:component>
            
            <pw:component name="pw_div" data-show="true" data-class="row" data-id="">
                <pw:container>

                    <pw:component name="pw_div" data-show="true" data-class="span2" data-id="">
                        <pw:container>
                            <pw:component name="pw_include_view" data-show="true" data-src="sample_sidebar.html"></pw:component>
                        </pw:container>
                    </pw:component>

                    <pw:component name="pw_div" data-show="true" data-class="span10" data-id="">
                        <pw:container>

                            <pw:component name="pw_form" data-show="true" data-class="" data-id="" data-action="" data-enctype="multipart/form-data" data-method="post">
                                <pw:container>

                                    <pw:component name="pw_text" data-show="true" data-content="Create {$entity->singular}" data-tag="legend" data-free=""></pw:component>
                                    {foreach from=$entity->attribute item="attribute"}
                                        {$attribute->getTemplate('createComponent')}
                                    {/foreach}

                                    {foreach from=$entity->getHasOne() item="oneRelated"}
                                    <pw:component name="pw_text" data-show="true" data-content="{$oneRelated->singular|capitalize}" data-tag="label" data-free=""></pw:component>
                                    <pw:component name="pw_combo_box" data-show="true" data-from="{$oneRelated->plural}" data-item="{$oneRelated->singular}" data-name="{$oneRelated->singular}" data-caption="{$oneRelated->attribute->name}" data-optvalue="id" data-selectedcond="${$entity->singular}->{$oneRelated->singular}->id == ${$oneRelated->singular}->id"></pw:component>
                                    {/foreach}

                                    {foreach from=$entity->getHasManyToMany() item="manyRelated"}
                                    <pw:component name="pw_checkbox_group" data-show="true" data-div_class="pw-checkbox-group" data-tag="legend" data-group_title="{$manyRelated->plural}" data-from="${$manyRelated->plural}" data-item="{$manyRelated->singular}" data-input_name="{$manyRelated->plural}" data-input_value="{literal}{${/literal}{$manyRelated->singular}{literal}->id}{/literal}" data-checked_condition="false" data-label="{literal}{${/literal}{$manyRelated->singular}->{$manyRelated->attribute->name}{literal}}{/literal}"></pw:component>
                                    {/foreach}

                                    <pw:component name="pw_div" data-show="true" data-class="form-actions" data-id="">
                                        <pw:container>
                                            <pw:component name="pw_button" data-show="true" data-id="" data-name="" data-caption="Create {$entity->singular}" data-free="class='btn btn-primary'" data-type="submit"></pw:component>
                                        </pw:container>
                                    </pw:component> <!-- .form-actions -->

                                </pw:container>
                            </pw:component> <!-- form -->

                        </pw:container>
                    </pw:component> <!-- .span10 -->

                </pw:container>
            </pw:component> <!-- .row -->

            <pw:component name="pw_include_view" data-show="true" data-src="footer.html"></pw:component>

        </div><!-- .container -->

        <pw:component name="pw_include_view" data-show="true" data-src="footer_scripts.html"></pw:component>
        
    </pw:body>
</pw:html>